package com.cj.pj.sys.controller;

import com.cj.pj.sys.common.pojo.JsonResult;
import com.cj.pj.sys.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/menu")
public class SysMenuController {
    @Autowired
    SysMenuService sysMenuService;

    @GetMapping("findMenu")
    public JsonResult findAllMenu(){
        return new JsonResult(sysMenuService.findMenus());
    }

    @RequestMapping("deleteMenuById")
    public JsonResult deleteMenuById(Integer id){
        return new JsonResult(sysMenuService.deleteMenuById(id));
    }

    @RequestMapping("/getNode")
    public JsonResult getNode(){
        return  new JsonResult(sysMenuService.getNode());
    }
}
